home *** CD-ROM | disk | FTP | other *** search
- /* CycleDatabase.h */
-
- /* File contains defines and funtion defintions for some functions */
-
- // These are the gadget indexes
- #define MYGAD_PREVIOUS (0)
- #define MYGAD_PREVTEXT (1)
- #define MYGAD_RECCOUNT (2)
- #define MYGAD_NEXTTEXT (3)
- #define MYGAD_NEXT (4)
- #define MYGAD_DESTGAD (5)
- #define MYGAD_DATEGAD (6)
- #define MYGAD_DIST1 (7)
- #define MYGAD_DISTPOINT (8)
- #define MYGAD_DIST2 (9)
- #define MYGAD_CYCLEOUTH (10)
- #define MYGAD_CYCLEOUTM (11)
- #define MYGAD_CYCLEBACKH (12)
- #define MYGAD_CYCLEBACKM (13)
- #define MYGAD_TRAINTICK (14)
- #define MYGAD_TRAINOUTH (15)
- #define MYGAD_TRAINOUTM (16)
- #define MYGAD_TRAINBACKH (17)
- #define MYGAD_TRAINBACKM (18)
- #define MYGAD_TOTTIMEH (19)
- #define MYGAD_TOTTIMEM (20)
-
- // This string uniquely identifies CycleDBase save files
- #define FILEDEF "scorpio"
- #define DEFLENGTH (7)
- // This is the length of the records array
- #define RECORD_LEN 2
- // These are the sizes of the destination and date fields
- #define DESTLENGTH 100
- #define DATELENGTH 8
- // This is the total number of gadgets
- #define NUM_GADS (21)
- // This is the number of gadget special pointers
- #define PTRS (3)
- // This is the maximum number of trips in the database
- const TRIPS = 100;
-
- struct TextAttr Topaz80 = { "topaz.font", 8, 0, 0, };
-
- struct Library *IntuitionBase;
- struct Library *GfxBase;
- struct Library *GadToolsBase;
- struct Library *AslBase = NULL;
-
- struct EasyStruct nofont =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Topaz font not available.\n",
- "OK",
- };
-
- struct EasyStruct noscreen =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Screen cannot be locked.\n",
- "OK",
- };
-
- struct EasyStruct novisinfo =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Cannot load Visual Information.\n",
- "OK",
- };
-
- struct EasyStruct nogadgets =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Gadgets cannot be created.\n",
- "OK",
- };
-
- struct EasyStruct nowindow =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Main window cannot be opened.\n",
- "OK",
- };
-
- struct EasyStruct nointuition =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Intuition Library v37+ not found.\n",
- "OK",
- };
-
- struct EasyStruct nographics =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Graphics Library v37+ not found.\n",
- "OK",
- };
-
- struct EasyStruct nogadtools =
- {
- sizeof(struct EasyStruct),
- 0,
- "Startup Problem",
- "Gadtools Library v37+ not found.\n",
- "OK",
- };
-
- struct EasyStruct notfound =
- {
- sizeof(struct EasyStruct),
- 0,
- "Search Problem",
- "Search string not found.\n",
- "OK",
- };
-
- struct EasyStruct nofilerequester =
- {
- sizeof(struct EasyStruct),
- 0,
- "Fatal Error",
- "Cannot open file requester.\n",
- "OK",
- };
-
- struct EasyStruct loadfail =
- {
- sizeof(struct EasyStruct),
- 0,
- "Loading Problem",
- "Error while loading.\n",
- "OK",
- };
-
- struct EasyStruct invalidfile =
- {
- sizeof(struct EasyStruct),
- 0,
- "Loading Problem",
- "File not recognised.\n",
- "OK",
- };
-
- struct EasyStruct savefail =
- {
- sizeof(struct EasyStruct),
- 0,
- "Saving Problem",
- "Error while saving.\n",
- "OK",
- };
-
- struct EasyStruct overwrite =
- {
- sizeof(struct EasyStruct),
- 0,
- "Attention!",
- "Overwrite records in memory?\n",
- "Yes|No"
- };
-
- struct EasyStruct saveover =
- {
- sizeof(struct EasyStruct),
- 0,
- "Attention!",
- "Overwrite this file?\n",
- "Yes|No"
- };
-
- struct EasyStruct notinuse =
- {
- sizeof(struct EasyStruct),
- 0,
- "Note",
- "This option is currently not available.\n",
- "OK",
- };
-
- UBYTE *vers = "$VER: filereq 39.0";
-
- #define MYLEFTEDGE 0
- #define MYTOPEDGE 0
- #define MYWIDTH 320
- #define MYHEIGHT 400
-
- struct Gadget *createAllGadgets(struct Gadget **, void *,
- UWORD, struct Gadget *[], struct StringInfo *[]);
-
- BOOL handleVanillaKey(struct Window *, UWORD,
- struct Gadget *[], int, int&);
-
- BOOL handleGadgetEvent(struct Screen *, struct Window *, struct Gadget *,
- UWORD, struct Gadget *[]);
-
- typedef struct header
- {
- char file_id[7];
- }head;
-
- typedef struct number_records
- {
- int recs[2];
- }num_recs;
-
- typedef struct details
- {
- char destination[DESTLENGTH];
- char date[DATELENGTH];
- int cycledist1;
- int cycledist2;
- int cycleouth;
- int cycleoutm;
- int cyclebackh;
- int cyclebackm;
- BOOL train;
- int trainouth;
- int trainoutm;
- int trainbackh;
- int trainbackm;
- int totalh;
- int totalm;
- // Is there anything in destination?
- BOOL changed;
- }data;
-
- head headerdata;
-
- num_recs records;
-
- data cycledata[TRIPS];
-
-